﻿using System;
using System.Collections;
using System.Collections.Generic;



namespace DailyFx.AI
{
	public interface IBlackboard
	{
		/**
		 * Opens a new <see cref="Zone"/>. Before which is not yet opened , 
		 * it is not possible to write <see cref="IBlock"/> to it.
		*/
		
		 void openZone ( Guid zone );

		/**
		 * Closes an open <see cref="Zone"/> and remove all <see cref="IBlock"/>s in it . 
		 * While the observers are not notified about the removal of block objects .
		*/
		 void closeZone ( Guid zone );


		/**
		 * Checks whether the <see cref="IBlackboard"/>contains an <see cref="IBlock"/> 
		 * which lives in a selected <see cref="Zone"/> 
		 * and is selected by the specified <see cref="IBlock"/>receiver.
		*/
		 Boolean hasBlock ( Guid zone, IBlock block );


		/**
		 * Returns the <see cref="Block"/> object which lives in a selected <see cref="Zone"/> 
		 * and is selected by the specified <see cref="IBlock"/> reciever.
		*/
		 IBlock readBlock ( Guid zone, IBlock block ) ;

		/**
		 * Writes a non-null <see cref="IBlock"/> object into a <see cref="Zone "/>
		 * on the <see cref="IBlackboard"/>.
		*/
		 bool writeBlock ( Guid zone, IBlock block );


		/**
		 * Removes and returns the <see cref="IBlock"/> object 
		 * which lives in a selected <see cref="Zone"/> 
		 * and is selected by the specified <see cref="IBlock"/> receiver.
		*/
		 bool takeBlock ( Guid zone, IBlock block ) ;

		/**
		 * Registers an <see cref="IObserver"/> which get's notified 
		 * when the <see cref="IBlock"/> receiver's state changes inside a selected <see cref="Zone"/>.
		*/
		 void registerObserver ( Guid zone, IObserver observer);

		
	}

}
